//
//  RootViewController.m
//  music
//
//  Created by LT on 2019/3/6.
//  Copyright © 2019 liu. All rights reserved.
//

#import "RootViewController.h"
#import "OneViewController.h"
#import "TwoViewController.h"
#import "ThreeViewController.h"
#import "DCNavTabBarController.h"
@interface RootViewController ()

@property (nonatomic,strong)UIWindow *window;

@end

@implementation RootViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    OneViewController *one=[[OneViewController alloc]init];
  
    TwoViewController*two=[[TwoViewController alloc]init];
    
    NSArray *subViewControllers = @[one,two];
    DCNavTabBarController *tabBarVC = [[DCNavTabBarController alloc]initWithSubViewControllers:subViewControllers];
    tabBarVC.view.frame = self.view.frame;
    
    [self.view addSubview:tabBarVC.view];
    [self addChildViewController:tabBarVC];
  


}

//隐藏导航栏  黑色的线
- (void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    
    self.navigationController.navigationBar.subviews[0].subviews[0].hidden = YES;
    [self.navigationController setNavigationBarHidden:YES animated:animated];
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    [self.navigationController setNavigationBarHidden:NO animated:animated];
}

@end
